<script setup lang="ts">
import DictTree from './DictTree.vue'
import DictTable from './DictTable.vue'
import type { DictType } from '@/apis/system/dict'

defineOptions({ name: 'Dict' })

const selectedDictType = ref<DictType>()
const selectedDictId = ref<string>()

const onDictSelect = (dictId: string, type: DictType) => {
  selectedDictId.value = dictId
  selectedDictType.value = type
}
</script>

<template>
  <ProPage title="字典配置" flex-table>
    <TreeTableLayout>
      <template #left>
        <DictTree @select="onDictSelect" />
      </template>
      <template #right>
        <DictTable :id="selectedDictId" :type="selectedDictType" />
      </template>
    </TreeTableLayout>
  </ProPage>
</template>

<style lang="less" scoped></style>
